<template>
	<div v-cloak class="aui-wrapper aui-page__iframe">
		<div class="aui-content__wrapper">
			<div class="aui-content">
				<el-card shadow="never" class="aui-card--fill">
					<div class="mod-lswms__receipt">
						<el-form :inline="true" :model="dataForm" >
							<el-form-item>
								<el-input v-model="dataForm.tray" ref="inputRef" size="small" placeholder="托盘号" clearable>
								</el-input>
							</el-form-item>
							<el-form-item>
								<el-button type="primary" size="small" @click="receiptEmptyLPN1()">入库</el-button>
							</el-form-item>
						</el-form>
					</div>
				</el-card>
			</div>
		</div>
	</div>
</template>

<script>
	import {
		ref,
		reactive,
		onMounted,
		nextTick
	} from 'vue';
	import {
		receiptEmptyLPN
	} from "@/network/lswms/receipt/Receipt.js"

	import {
		ElMessage,
		ElMessageBox
	} from 'element-plus'
	import {
		hasPermission
	} from "@/utils/hasPermission"
	export default {
		name: "ReceiptEmptyLPN",

		setup() {
			const dataForm = ref({})
			onMounted(() => {

			})
			
			const inputRef = ref(null) ;

			const receiptEmptyLPN1 = () => {
				receiptEmptyLPN({
					'tray': dataForm.value.tray
				}).then((res) => {
					if (res.code != 0) {
						return ElMessage.error(res.msg);
					}
					ElMessage({
						message: '操作成功',
						type: 'success',
						duration: 500,
						onClose: function() {
							dataForm.value.tray="";
							inputRef.value.focus();
						}
					});
				}).catch()
			}

			return {
				inputRef,
				dataForm,
				receiptEmptyLPN1
			}
		},
		methods: {
			hasPermission,

			reString: function(val) {
				let n = Number(val)
				if (!isNaN(n)) {
					return n
				} else {
					return val
				}
			}
		}
	}
</script>


<style lang="scss" scoped>


</style>
